<?php

namespace App\Http\Controllers;

use App\Api\Sms\SmsClient;
use App\Http\Controllers\Admin\LoginController as login;
use App\Jobs\BigData;
use App\Jobs\GetOrderStatus;
use App\Models\Admin\AdminUsers;
use App\Models\Product\GoodsModel;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Monolog\Formatter\LineFormatter;
use Monolog\Handler\RotatingFileHandler;
use Monolog\Logger;

// use App\Repository\LongFileRepository;

// use App\Repository\UpThree\MainOrderRepostition;

// use App\Repository\UpThree\BigDataRepostition;

// use App\Repository\UpThree\GetOrderStatusDataRepostition;

// use App\Repository\Order\OrderExportRepository;


class TestController extends Controller
{
    private $log = null;
    private $model = null;

    public function __construct(Request $request, login $RoleRepository)
    {
        $this->log = new Logger('TestChannel');
        $this->log->pushHandler(
            (new RotatingFileHandler(storage_path('/logs/TestChannel.log'), 14, Logger::DEBUG, true, 0777))->setFormatter(new LineFormatter(null, null, true, true))
        );
        parent::__construct(); //app('redirect')
        $this->model = $RoleRepository;
        ini_set('max_execution_time', 300);
    }

    // 队列启动  徐默认启动
    public function duilieMoren()
    {
        dispatch(new BigData(1, 'douyinFail'))->onQueue('TaskBigDataDispose'); // 抖音失败返回
        $page = 1;
        dispatch(new GetOrderStatus($page, 'getAllOrderStatus', 10))->onQueue('TaskGetOrderStatusDispose'); // 定时更新状态
        dispatch(new BigData(1, 'verificDouYin'))->onQueue('TaskBigDataDispose'); // 抖音信息验证
        // dispatch(new GetOrderStatus($page, 'getPddListAll', 30))->onQueue('TaskGetOrderStatusDispose'); // 拼多多 定时抓取订单
    }

    public function jobsCheck(Request $request)
    {
//        $rows = DB::table('jobs')->whereRaw('attempts>10')->get()->toArray();
//        print_r($rows);
        $where = 'attempts>50 and queue="TaskLongFileDispose"';
        $total = DB::table('jobs')->whereRaw($where)->count();
        DB::table('jobs')->whereRaw($where)->delete();
        return $this->returnMsg(200, '清现完成,共清理了:' . $total . '个任务');
    }

    public function t2(Request $request)
    {
        $file = storage_path('2.txt');
        $lines = file($file, FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES);
        //测试写入并换行
        $a = [];
        foreach ($lines as $line) {
            $a[] = $line;
        }
        $file = storage_path('1.txt');
        $lines = file($file, FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES);
        foreach ($lines as $line) {
            if (!in_array($line, $a)) {
                echo $line;
            }
        }
        return "OK";
    }

    public function ts()
    {
        $sms = new SmsClient(3);
        $phone = "13432453733";
        $tplId = "169137";
        $tplType = 2;
        $tplContent = "您办理的号卡还未激活，请尽快激活充值使用，7个工作日未激活号码会被收回，如激活遇问题可拨打人工客服:电话:{%客服电话%}";
        $tplParamsData = ['iccid' => 18938336688, 'express_phone' => 15992832334];
        return $sms->sendSmsByTpl($phone, $tplId, $tplType, $tplContent, $tplParamsData);
    }

    public function index(Request $request)
    {



        die();
        $str = '{"order_sn_increment_get_response":{"order_sn_list":[{"support_nationwide_warranty":0,"country":"中国","group_status":1,"free_sf":0,"discount_amount":0.0,"platform_discount":0.0,"return_freight_payer":0,"order_status":1,"id_card_num":"","risk_control_status":0,"province":"上海市","town_id":2705,"item_list":[{"goods_name":"联通流量卡纯流量卡上网卡电话卡大王卡4g5g手机卡长期全国通用","outer_goods_id":"","goods_price":0.99,"goods_id":209242552364,"sku_id":1587840456699,"goods_count":1,"goods_spec":"每月9元包440G+200分钟,【19-60周岁】限购1单","outer_id":"CDLT-29183G","goods_img":"https://img.pddpic.com/mms-material-img/2024-04-13/cf7479e9-d694-4333-aa8b-5db6a783af33.jpeg.a.jpeg"}],"pay_no":"","last_ship_time":"2024-06-11 10:31:01","delivery_one_day":0,"created_time":"2024-06-08 10:31:00","duo_duo_pay_reduction":0.0,"card_info_list":[],"refund_status":1,"town":"闵行区","is_stock_out":0,"open_address_id":"0FqPPR+0h0FM4g2a/ad2qRLVL7833myw/+a8jm9tto8sc7aC6c7Cy7IarDtBWSwq","receiver_address_mask":"马桥镇银康路*弄*号*室","receive_time":"","pay_time":"2024-06-08 10:31:01","gift_list":[],"capital_free_discount":0.0,"receiver_phone_mask":"1*********7","country_id":0,"city_id":321,"invoice_status":0,"service_fee_detail":[],"city":"上海市","order_tag_list":[{"name":"delivery_one_day","value":0},{"name":"no_trace_delivery","value":0},{"name":"self_contained","value":0},{"name":"return_freight_payer","value":0},{"name":"free_sf","value":0},{"name":"duoduo_wholesale","value":0},{"name":"support_nationwide_warranty","value":0},{"name":"only_support_replace","value":0},{"name":"oversea_tracing","value":0},{"name":"distributional_sale","value":0},{"name":"open_in_festival","value":0},{"name":"same_city_distribution","value":0},{"name":"region_black_delay_shipping","value":0},{"name":"has_subsidy_postage","value":0},{"name":"has_sf_express_service","value":0},{"name":"community_group","value":0},{"name":"has_ship_additional","value":0},{"name":"ship_additional_order","value":0},{"name":"conso_order","value":0},{"name":"professional_appraisal","value":0},{"name":"allergy_refund","value":0},{"name":"ship_hold","value":0},{"name":"home_delivery_door","value":0},{"name":"direct_mail_activity","value":0}],"is_lucky_flag":1,"yyps_time":"","mkt_biz_type":0,"shipping_type":0,"remark":"超60","pre_sale_time":"","inner_transaction_id":"","order_change_amount":0.0,"only_support_replace":0,"logistics_id":0,"updated_at":"2024-06-11 02:26:16","street":"","receiver_name_mask":"逸*","receiver_name":"~AgAAAAK4aN4Fl3JXuwApyT533p7Gq9gKK9LxXgOvwjI=~15~","tracking_number":"","pay_type":"","duoduo_wholesale":0,"buyer_memo":"","is_pre_sale":0,"shipping_time":"","home_delivery_type":0,"after_sales_status":0,"address":"~AgAAAAK4aN4Hl3JXuwHe+JF6x3s5MhSYXotGkdkutsTdq/tPZXtJxvNCO2xdHaSezeU4q66sOavpc+lwhK+dTGeFrmFb67ky71VToHuotGVcQyej+zHHFbW1ri/7thJ4KSxbMnz+it5snBKkfNRHfQ==~15~","id_card_name":"","self_contained":0,"goods_amount":0.99,"pay_amount":0.99,"seller_discount":0.0,"address_mask":"上海市上海市闵行区马桥镇银康路*弄*号*室","yyps_date":"","confirm_status":1,"confirm_time":"2024-06-08 10:31:01","stock_out_handle_status":-1,"postage":0.0,"province_id":25,"cat_id_3":9137,"cat_id_4":0,"cat_id_1":8733,"receiver_address":"~AgAAAAK4aN4Il3JXuwHpTRCGUwf8JBSuDlUb+wLsUKbSYXivWKSEAlYClEGC0CNhbDo3IF7Tx0UeJnoj1yTLEcqiNrviwlOnS45ACCltrXI=~15~","cat_id_2":8827,"trade_type":0,"urge_shipping_time":"","receiver_phone":"$AgAAAAK4aN4Gl3JXuwB8/VOtcZhQQfoXB53wCABj/jI=$15$","order_sn":"240608-572029735322325"}],"total_count":1,"has_next":false,"request_id":"17180439794623918"}}';


            
        $str = '{"shop_order_id":6930702990411962026}返回的参数{"code":10000,"msg":"success","sub_code":"","sub_msg":"","data":{"shop_order_detail":{"total_promotion_amount":0,"early_arrival":false,"recommend_end_ship_time":0,"open_id":"","biz_desc":"通信卡","trade_type_desc":"普通","b_type_desc":"电商SDK","ship_time":0,"accept_order_status":0,"main_status_desc":"已全部支付","buyer_words":"","sub_b_type_desc":"电商SDK-头条","order_amount":1,"encrypt_post_receiver":"##HwrMvve2JZT08+u11kjAjHpyeKMzVH0YjJ0Yiq8XAt0wSrfvSIianJ/ys3Sqd8lJiUlWWChE1Vih+FUFWLXnJGtuwhnHrpazl22aNT7CMU4=*CgYIASAHKAESPgo8P81PlAxYJ41Ydal+/bTNJpR3SnaIeyzgCeGdgJ3MzwFh3XER/n/mOKnqchCwazwLAjPECxACtMCiByc8GgA=#1##","supermarket_order_serial_no":"","aweme_id":"","seller_words":"","b_type":29,"exp_ship_time":1718121663,"promotion_redpack_platform_amount":0,"appointment_ship_time":0,"promise_info":null,"target_arrival_time":0,"shop_id":96695708,"main_status":105,"app_id":7386,"promotion_talent_amount":0,"shop_order_tag_ui":[],"post_origin_amount":0,"encrypt_pay_tel":"","post_insurance_amount":0,"modify_amount":0,"post_receiver":"","doudian_open_id":"1@#rZoJY+y8+qM5xGYsgfUdgBcIvY+uslg55xZMLvRu/MP6qDrguTsMcbvmR1LNatS7B8rlhGPc","promotion_redpack_talent_amount":0,"greet_words":"","fulfill_status":"","order_status_desc":"已支付","cancel_reason":"","author_cost_amount":0,"mask_post_receiver":"余**","update_time":1717948877,"post_tel":"","order_id":"6930702990411962026","d_car_shop_biz_data":{"poi_addr":null,"poi_tel":null,"poi_pname":null,"poi_city_name":null,"poi_adname":null,"poi_id":null,"poi_name":null},"pay_tel":"","promotion_pay_amount":0,"post_addr":{"province":{"name":"浙江省","id":"33"},"city":{"name":"杭州市","id":"330100"},"town":{"name":"拱墅区","id":"3301050000000"},"street":{"id":"3301050070000","name":"大关街道"},"detail":"","encrypt_detail":"##CAGSvvWFn/OzATIsz4T8WM+fjqUlaWFLuQ0TKtrOYTnQoDlum9qjgo4kVOE/b33TWveTjWlGansRqm7PcJfG+5eMmyC57HmQGsz1GL9RCQAVOT7rE8fudFHEt0vAsEFrn6izkXGW5Quiq5wDk5+nzQ8pOw==*CgYIASAHKAESPgo8hpoMdp5bLRzlFAYfto8+ctk7/TpMx8AuAbd5HGSqGW3ywbmQ82U6H3WYB6ioQUTSPvfUT2mWsa1je2G4GgA=#1##"},"user_nick_name":"","receipt_date":"","order_recycle_info":{"recycle_status":0,"recycle_status_desc":null,"appoint_recycle_start_time":0,"appoint_recycle_end_time":0,"quoted_price":0,"recycle_order_id":null,"subsidy_receive_status":null,"supplier_code":null,"supplier_name":null,"recycle_mode":0,"pronduct_desc":null},"shop_name":"电话卡手机卡流量卡星卡","order_type_desc":"普通订单","promotion_shop_amount":0,"encrypt_post_tel":"$$k/2Z7++cFSRADiOOrVoqb4AoEbVQHd02a3n/bOpa1GSvj+Kw/T6a0ZiXOlV4fHpchZsyKXcKcec71TxlYYajDctYQ1dby/cbV0s32FirbgCETg==*CgYIASAHKAESPgo8QZePVcEZKRutiPI+w386XmANQFo2ctCGrvW9vz1qOyOwhxXxNkPnyv4uV/p/aDq3KgN2Z6YLIzHjXDWVGgA=$1$$","modify_post_amount":0,"sku_order_list":[{"product_id":3688640225967473039,"promotion_detail":{"shop_discount_detail":{"coupon_amount":0,"full_discount_amount":0,"coupon_info":[],"full_discount_info":[],"redpack_amount":0,"redpack_info":[],"total_amount":0},"platform_discount_detail":{"full_discount_amount":0,"coupon_info":[],"full_discount_info":[],"redpack_amount":0,"coupon_amount":0,"allowance_amount":0,"user_balance_amount":0,"total_amount":0,"redpack_info":[],"gold_coin_amount":0,"official_deduction_amount":0},"kol_discount_detail":{"full_discount_amount":0,"coupon_info":[],"full_discount_info":[],"redpack_amount":0,"redpack_info":[],"total_amount":0,"coupon_amount":0}},"inventory_list":[{"out_warehouse_id":"","inventory_type":1,"inventory_type_desc":"普通库存","count":1,"warehouse_type":0,"warehouse_name":"","warehouse_id":""}],"finish_time":0,"c_biz_desc":"精选联盟","promotion_amount":0,"appointment_ship_time":0,"exp_ship_time":1718121663,"sku_order_tag_ui":[{"sort":0,"extra":"","key":"unsupport_7days_refund_after_use","text":"7天","hover_text":"支持7天无理由退货（使用后不支持）","tag_type":"","help_doc":"https://school.jinritemai.com/doudian/web/article/101835?from=shop_article"},{"help_doc":"","sort":0,"extra":"","key":"c_biz_alliance","text":"精选联盟","hover_text":"达人通过精选联盟选品，或通过链接添加非人店一体/渠道号店铺商品到橱窗、视频、直播，产生的订单为联盟订单","tag_type":"grey"}],"product_name":"电信手机卡5g流量卡校园卡上网卡电话卡不限速不卡顿","bundle_sku_info":[],"biz":53,"spec":[{"name":"默认","value":"默认"}],"has_tax":false,"author_cost_amount":0,"send_pay":0,"pre_sale_type":0,"given_product_type":"","inventory_type_desc":"","trade_type":0,"b_type":29,"supplier_id":"","order_amount":1,"sku_id":3406528289073922,"second_cid":21574,"quality_inspection_status":0,"order_type":0,"post_insurance_amount":0,"sku_car_model_desc":"","order_expire_time":1800,"source_platform":"","video_id":"","promotion_shop_amount":0,"platform_cost_amount":0,"post_tel":"","parent_order_id":"6930702990411962026","order_status_desc":"已支付","channel_payment_no":"TP2024061000005600300482715094","goods_price":1,"warehouse_ids":[],"mask_post_addr":{"street":{"name":"大关街道","id":"3301050070000"},"detail":"香积*路*********单元***","province":{"id":"33","name":"浙江省"},"city":{"name":"杭州市","id":"330100"},"town":{"id":"3301050000000","name":"拱墅区"}},"writeoff_info":[],"card_voucher":{"valid_days":0,"valid_start":0,"valid_end":0},"order_level":3,"pay_type":4,"item_num":1,"reduce_stock_type_desc":"支付减库存预占","account_list":{"account_info":[]},"first_cid":20096,"reduce_stock_type":3,"campaign_info":[],"biz_desc":"通信卡","sub_b_type":13,"page_id":0,"logistics_receipt_time":0,"theme_type":"1","app_id":7386,"c_biz":2,"promotion_platform_amount":0,"post_addr":{"province":{"name":"浙江省","id":"33"},"city":{"name":"杭州市","id":"330100"},"town":{"name":"拱墅区","id":"3301050000000"},"street":{"name":"大关街道","id":"3301050070000"},"detail":"","encrypt_detail":"##Kcj+ds43QGUAv4jiCx9vuPD3E/umTdU1MX07A2brfrPeqtL2URbVec3nZGSy16qnl8+XCLO0Fa3P3resFQGy3ddPWuyosUhp5Vid1C8ObZndM7mhfadxleVp9Gb9y2jm+00XLDGbODOs9Vro4bQ8NL9iWQ==*CgYIASAHKAESPgo8QKkDHxGeJzrNBfAFq+JTiHP8lgNFpR/9W8LlU6GqH3p+6qrmB8Ss5v0Zl8dxGZNsdCKgMxsjp0e6mt+AGgA=#1##"},"post_amount":0,"after_sale_info":{"after_sale_status":0,"after_sale_type":0,"refund_status":0},"promotion_redpack_talent_amount":0,"promotion_pay_amount_details":[],"theme_type_desc":"直播间","modify_amount":0,"product_id_str":"3688640225967473039","promise_info":"{\"identifier\":\"S#2024-06-12\"}","author_id":2518323083619827,"content_id":"0","modify_post_amount":0,"fourth_cid":0,"is_comment":0,"pay_time":1717948877,"create_time":1717948863,"update_time":1717948877,"relation_order":{"write_off_no":null,"relation_order_id":null},"need_serial_number":false,"only_platform_cost_amount":0,"mask_post_receiver":"余**","out_sku_id":"","out_warehouse_ids":[],"product_pic":"https://p9-aio.ecombdimg.com/obj/ecom-shop-material/jlMDZGed_m_fff725910ea05a55299d75a2e0539bb4_sx_281891_www800-800","encrypt_post_receiver":"##m5G77sgBB2yQMNYwBtrF1UtqEBoOUXYiO/Z7NpYPgEWF+Re5ULvqEfyJFrBtoO0a0DaOXpkTx7McBcwykDJSSHT0S84o0pX0MHu0tQ2nzQ0=*CgYIASAHKAESPgo8t9zGp4BpTMZMFwEvOQNfF4hLIxklnmhMYtHGyOqo88SMW1VwM5MyMxc4bv2IzbjoXUuhHLsct+DifhXhGgA=#1##","tax_amount_not_come_out":0,"order_id":"6930702990411962026","goods_type":0,"promotion_talent_amount":0,"room_id_str":"7377595319866886948","encrypt_post_tel":"$$+JTneOgTMsMtUand/9nc89dNEAcWmbbqyVS164rn7VuXRzEMw4RY5elUIZllPwSAC3/5TnSZZCR+ouGRTxSU0dvPcCqa1FrW7aI8e1ddXOte+g==*CgYIASAHKAESPgo8RtFV3q9Z9utr2OY1z+z4hJeQFZ0kBEyGyLoflSvRAV3mulPSxusV0JUjsQU5WYiulRuMJ5tUYTGh2MAfGgA=$1$$","packing_charge_amount":0,"extra_info":{},"origin_id":"2518323083619827_7377595319866886948_3688642664351306646","sku_customization_info":[],"voucher_deduction_amount":0,"code":"GZDX-H19135G0529","promotion_redpack_amount":0,"inventory_type":"","cancel_reason":"","origin_amount":1,"ad_env_type":"","main_status_desc":"已全部支付","b_type_desc":"电商SDK","confirm_receipt_time":0,"receive_type":0,"mask_post_tel":"1********28","sub_b_type_desc":"电商SDK-头条","room_id":7377595319866886948,"cid":0,"out_product_id":"0","master_sku_order_id":"","trade_type_desc":"普通","send_pay_desc":"-","promotion_pay_amount":0,"pay_amount":1,"order_status":105,"post_receiver":"","sum_amount":1,"ship_time":0,"promotion_redpack_platform_amount":0,"is_activity":false,"order_type_desc":"普通订单","author_name":"电话卡19元无限流量移动联通流量卡电信卡","tax_amount":0,"main_status":105,"shop_cost_amount":0,"third_cid":28097}],"seller_remark_stars":0,"order_phase_list":[],"promotion_redpack_amount":0,"address_tag_ui":[],"order_tag":{},"user_icon":"","tax_amount_not_come_out":0,"channel_payment_no":"TP2024061000005600300482715094","promotion_platform_amount":0,"earliest_receipt_time":0,"promotion_detail":{"shop_discount_detail":{"full_discount_info":[],"redpack_info":[],"redpack_amount":0,"total_amount":0,"coupon_amount":0,"full_discount_amount":0,"coupon_info":[]},"platform_discount_detail":{"total_amount":0,"coupon_amount":0,"full_discount_info":[],"redpack_info":[],"allowance_amount":0,"user_balance_amount":0,"coupon_info":[],"redpack_amount":0,"gold_coin_amount":0,"official_deduction_amount":0,"full_discount_amount":0},"kol_discount_detail":{"full_discount_info":[],"redpack_amount":0,"redpack_info":[],"total_amount":0,"coupon_amount":0,"full_discount_amount":0,"coupon_info":[]}},"user_id_info":{"id_card_name":"","encrypt_id_card_no":"~~dr6wBlwhgu1XXzX8rMZsmpNEZPG2W8VKmxnImTMrjq/vNHLE48wsjggWcncPcKWsBZzMcy/NREOp0+tYrIDMb5rLNQNwa9Mbg0OS0Q/LTIURyHmm7NiB59c=*CgYIASAHKAESPgo8PZnWSS8N+LQAXEG9lyB12hdCOyvpuPQvqMmPolubLO8jX3VvVLzIFSAiJS3s/Bx6Zz6SK2BRh2kRSYb+GgA=~1~~","encrypt_id_card_name":"##zBlpzYjsC73+UFSxQ7SBRNAXa0nLxGYwv15aEuwhEse2sQfsroLzSedS6U/QTwVcT0Wbe07sMfFrXwPL7J+ZNjLIwQnLmyPrB1CwnzuZ3zU=*CgYIASAHKAESPgo8E4WNiz4RvUFoMaajw1Fd6Suhnkonh8QQsyERSUIplsmq+4MounFc4sCG55C09hybgC8on8XYa7MLpoCnGgA=#1##","id_card_no":""},"original_shop_id":0,"receipt_time_map":{},"recommend_start_ship_time":0,"biz":53,"order_type":0,"sub_b_type":13,"user_coordinate":{"user_coordinate_longitude":"120.157204","user_coordinate_latitude":"30.302252"},"pay_type":4,"post_amount":0,"shop_cost_amount":0,"mask_post_tel":"1********28","latest_receipt_time":0,"tax_amount":0,"trade_type":0,"finish_time":0,"serial_number_list":[],"only_platform_cost_amount":0,"mask_pay_tel":"","open_address_id":"#iC0y5TZ3vj3qAFLxKdH53DU5zDIdbi7ajtF+UiuDWuEUt0nzaSFdDJE/aOIKDoRXxurOmXjO74oo66Z9qjtsbpeQl0p4tsMWcpeej9qZybgrUfqTTqFkooYtYoKRWJvzra5dGL0DHYQ=","pay_time":1717948877,"create_time":1717948863,"pay_amount":1,"promotion_amount":0,"logistics_info":[],"post_promotion_amount":0,"packing_amount":0,"order_level":2,"order_status":105,"order_expire_time":1800,"platform_cost_amount":0,"user_tag_ui":[{"key":"user_profile_shop_customer_type","text":"店铺新客"}],"mask_post_addr":{"street":{"name":"大关街道","id":"3301050070000"},"detail":"香积*路*********单元***","province":{"name":"浙江省","id":"33"},"city":{"name":"杭州市","id":"330100"},"town":{"name":"拱墅区","id":"3301050000000"}}}},"log_id":"20240610000129348C3DF327D0A882A181"}';
        // $times = date('Y-m-d 01:00:00', strtotime('+1 day'));
        // $time = strtotime($times) - time();
        // var_dump($time);
        // die();
        $model = new \App\Repository\GoodsPhone\AutoGoodsPhoneRepository();
        // $res = $model -> getPhoneConfig();
        $arr = json_decode('{"product_id":1,"goods_id":1,"goods_name":"\u5916\u90e8\u540d\u79f0","goods_code":"\u53f7","nums":12,"shop_id":1}',true);
        $res = $model -> getAutoPhone(1,$arr);
        var_dump($res);
        die();

//        return $this->tt2();
        $model = new AdminUsers();
        return $model->where(['user_name' => 'test'])->update(['status' => 0]);
//        $model = new RebateLogsRepository();
//        return $model->importData(1069);
//        $res = 1038;
//        $sql = "ALTER TABLE `card_commission_return_logs` DROP `md5sum`;";
//        $rows = DB::statement($sql);
//        return "OK";
//        $sql = "select * from `card_xh_phones` where number REGEXP '<[0-9]>{2,}'";
//        $sql = " select * from `card_xh_phones` where number REGEXP '([\\d])\\1{2,}'";
//        $sql = " select * from `card_orders` limit 1";
//        $rows = DB::select($sql);
//
//        print_r($rows);
//        return "OK";
//        $rows = DB::table('admin_users')->where(['user_name' => 'test'])->update(['status' => 0]);
//        return $rows;
    }

    public function tt2()
    {
        $param = [
//            'groupKey' => '3804016079',
            'id' => 262,
            'codeTypeCode' => 'AA',
//            'searchValue' => '123',
            'product_id' => 214,
            'qryType' => '01',
            'niceTag' => '1',
            'featureType' => '03',
            'amounts' => 10
        ];
        $apiGoodsModel = new GoodsModel();
//        $resGoods = $apiGoodsModel->where(['id' => $param['id']])->select(['id', 'product_id'])->first();
//        if (empty($resGoods->product_id)) {
//            return $this->returnMsg(102, '未查询到产品');
//        }
        $productId = 214;
        $apiGoodsRepository = new \App\Repository\Api\GoodsRepository();
        $data = $apiGoodsRepository->getSelectNumberTwo($productId, $param);
//        $data = $apiGoodsRepository->getSelectNumber($productId, $param);
        return $data;
    }
}
